function checkInput() {
    //var form = document.getElementById('register');
    var username = document.getElementById('username1').value;
    var password1 = document.getElementById('password1').value;
	var password2 = document.getElementById('password2').value;
    var button = document.getElementsByTagName('button')[0];
    if (username && password1 && password2 && password1==password2)
        button.disabled = false;
    else
        button.disabled = true;
}
function regiest(user,pass){
	var params={
			"username":user,
			"password":pass
	};
	if(user.length>20||pass.length>20||user.length==0||pass.length==0){
		alert("用户名或密码不能为空且不能超过20个字符")
	}else{
	$.ajax({
        "contentType": "application/json; charset=utf-8",
        "type": "POST",
        "url": "regiest",
        "data": JSON.stringify(params),   
        "success": function (data,textStatus) {
            console.log(data);
            if(data){
            	alert("注册成功，跳转到登录界面");
            	location="index.html"
            }else{
            	alert("用户名重复");
            }
        }
    });
	//return false;
	}
}
$(document).ready(function(){
	$("#ConfigurationButton").click(function(){
		regiest($("#username1").val(),$("#password1").val()	);	
	});
});